package com.csyaonie.kotlin.ui

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Adapter
import android.widget.ArrayAdapter
import android.widget.ListAdapter
import com.csyaonie.kotlin.R
import kotlinx.android.synthetic.main.activity_test_list_view.*

class TestListView : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_test_list_view)

        val list= listOf("Apple","banana","Orange","Pear","Grape","Wartermelon")
        val adapter:Adapter=ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,list)
        listview.adapter= adapter as ListAdapter?
    }
}